

package com.example.administrator.caigou51.recyclerCard.cardView;

import android.content.Context;
import android.content.Intent;
import android.util.AttributeSet;
import android.view.View;
import android.widget.TextView;

import com.example.administrator.caigou51.R;
import com.example.administrator.caigou51.activity.CheckOrderActivity;
import com.example.administrator.caigou51.activity.GoodsDetailsActivity;
import com.example.administrator.caigou51.activity.MainActivity;
import com.example.administrator.caigou51.activity.MessageHuoDongActivity;
import com.example.administrator.caigou51.activity.OrderListActivity;
import com.example.administrator.caigou51.activity.PayMoneyActivity;
import com.example.administrator.caigou51.activity.ZhuanZhangPayActivity;
import com.example.administrator.caigou51.global.AppManager;
import com.example.administrator.caigou51.recyclerCard.basic.CardItemView;
import com.example.administrator.caigou51.recyclerCard.card.TradeSuccess1Card;


public class TradeSuccess1CardView extends CardItemView<TradeSuccess1Card> {
 	private Context mContext;
    private TextView textViewGoToOrder;
    private TextView textViewGoToMain;
    private TextView  textViewPayStyle;
    private TextView  textViewPayMoney,textViewTips;
    public TradeSuccess1CardView(Context context) {
        super(context);
        mContext=context;
        // TODO Auto-generated constructor stub
    }

    public TradeSuccess1CardView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext=context;
        // TODO Auto-generated constructor stub
    }

    public TradeSuccess1CardView(Context context,
                                    AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
        mContext=context;
        // TODO Auto-generated constructor stub
    }
    @Override
    public void build(TradeSuccess1Card card) {
        // TODO Auto-generated method stub
        super.build(card);
        textViewTips= (TextView) findViewById(R.id.textViewTips);
        textViewGoToOrder= (TextView) findViewById(R.id.textViewGoToOrder);
        textViewGoToMain= (TextView) findViewById(R.id.textViewGoToMain);
        textViewPayStyle= (TextView) findViewById(R.id.textViewPayStyle);
        textViewPayMoney= (TextView) findViewById(R.id.textViewPayMoney);
        textViewGoToOrder.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent2=new Intent(mContext, OrderListActivity.class);
                intent2.putExtra(OrderListActivity.TagFromTradeSuccess,true);
                mContext.startActivity(intent2);
            }
        });

        textViewGoToMain.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent=new Intent(mContext, MainActivity.class);
                mContext.startActivity(intent);
            }
        });
        textViewPayStyle.setText(card.getPayStyle());
        textViewPayMoney.setText(card.getPayTotal());
        textViewTips.setText(card.getPayTips());
    }
}
